<!--<?php
print <<<EOT
-->

<script src="css/edit.js"></script>
<script>
<!--
var preEditID=0;
function EditClick(id)
{
    if(preEditID>0 && preEditID !=id)
    {
        $("#spanWish_"+preEditID).show();
        $("#txtWish_"+preEditID).hide();
        $("#edit_"+preEditID).show();
        $("#submit_"+preEditID).hide();
        $("#cancel_"+preEditID).hide();
    }
    preEditID = id;
    
    $("#spanWish_"+id).hide();
    $("#txtWish_"+id).val($("#spanWish_"+id).text()).show();
    
    $("#edit_"+id).hide();
    $("#submit_"+id).show();
    $("#cancel_"+id).show();
}
function SubmitClick(id)
{
    if($.trim($("#txtWish_"+id).val())=="") 
    {
        alert('Please input the wish list name');
        $("#txtWish_"+id).focus();
        return;
    }
    else if($.trim($("#txtWish_"+id).val())==$("#spanWish_"+id).text())
    {
        CancelClick(id,false)
    }
    else
    {
        url = "wishlist_view.php?act=edit&wname="+$("#txtWish_"+id).val()+"&wid="+id;
        document.getElementById('addwishlistiframe').src=url;
    }
}
function CancelClick(id,submit)
{
    if(submit)  $("#spanWish_"+id).val($("#txtWish_"+id).val()).show();
    else $("#spanWish_"+id).show();
    
    $("#txtWish_"+id).hide();    
    $("#edit_"+id).show();
    $("#submit_"+id).hide();
    $("#cancel_"+id).hide();
}

function sendFriend(wid) {
    url = "wishlist_send.php?wid="+wid;
    open(url,'wishlist_send_page','width=400,height=320');
}

//-->
</script>
 <div class="main_R">  
 
 <div class="tb-top-logo">
           <img src="css/images/about_jansen_furniture.jpg" alt="" />
            </div>
              <div class="right-pad">   
              
                  <table width="745" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" >                      
                      <div>
                
                      
                        <table width="720" border="0" cellspacing="0" cellpadding="0">                         
                          <tr>
                            <td align="left" class="pageTitleText">Your currently have $sql_all_num list{$s}.</td>
                          </tr>
                          <tr>
                            <td align="center" class="pageListings">{$page_show['pagelink']}</td>
                          </tr>
                        </table>                        
                        <div><img name="" src="./images/spacer.gif" width="538" height="5" alt=""></div></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                
                    </tr>                   
                  </table>
                  
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>
                  
                  <table width="745" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="538"><img name="" src="./images/spacer.gif" width="538" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="245" alt=""></td>
                      <td bgcolor="FFFFFF"  class="text" align="left" valign="top">
                      <iframe name='addwishlistiframe' width=0 height=0 src="about:blank" id='addwishlistiframe' style="display:none"></iframe>
                        <table width="730" border="0" cellspacing="0" cellpadding="0" align=center>
			    	      <tr>
			    	        <td class=titles vAlign=center align=left width=50 height=20>&nbsp;</td>
			               <!-- <td class=titles vAlign=center align=middle width=50 height=20>List</td>-->
			                <td class=titles vAlign=center align=middle width=150 height=20>Name</td>
			                <td class=titles vAlign=center align=left width=217 height=20>List Log</td>
			                <td class=titles vAlign=center align=middle width=76 height=20>Total Items</td>
			                <td class=titles vAlign=center align=middle colSpan=3 height=20>Actions</td>
			              </tr>
   
<!--
EOT;
foreach ($wishlist_ary as $v) {
    $date = date('d/M/Y \a\t H:i', $v['date']);
    $num = count(explode("|", $v['product_list']));
    
    $s = '';
    if (!empty($sendrecord_ary[$v['id']])) {
        foreach ($sendrecord_ary[$v['id']] as $vv) {
            $date1 = date('d/M/Y \a\t H:i', $vv['date']);
            $s .= '<tr height=30 bgcolor="#DBE0E4" >    	        
                <td class=text vAlign=center colspan=2></td>
                <td class="wish_list_message_sent" vAlign=center colspan=3 align="left">
                 <img src="./images/misc/jf_misc_wishlist_sent_icon_blue_015.gif" alt="Sent"  width="13" height="10" id="jf_misc_wishlist_sent_icon_blue_015"> Sent to \'' . $vv['friend_name'] . '\' on ' . $date1 . '.
                 </td>
                </tr>';
        }
        $s .= '<tr><td colspan=8 height=4></td></tr>';
    }
print <<<EOT
-->   
			              <tr><td colspan=8 bgcolor="#000000" height=1></td></tr>
			    	      <tr>
			    	        <td class=text vAlign=center align=left width=50 height=22><a onclick="return confirm('Do you really want to remove this from your wish list?')" href="wishlist_view.php?act=delall&wid={$v['id']}"  onmouseover="jf_button_remove_{$v['id']}.src='./images/button/jf_button_remove-over.gif'" onmouseout="jf_button_remove_{$v['id']}.src='./images/button/jf_button_remove.gif'" ><img src="./images/button/jf_button_remove.gif" alt="Remove This Item From Your Wish List" name="jf_button_remove_01" width="50" height="13" border="0" id="jf_button_remove_{$v['id']}"></a></td>
			               <!-- <td class=text vAlign=center align=middle width=50>1</td>-->
			               <td class=text vAlign=center align=middle width=150><span id="spanWish_{$v['id']}">{$v['name']}</span><input type="text" name="wname_{$v['id']}" value="{$v['name']}" size="50" class="wishlist_input" id="txtWish_{$v['id']}" style="display:none;"/> </td>
			                <td class=text vAlign=center align=left width=217>Created on $date</td>
			                <td class=text vAlign=center align=middle width=76>$num</td>
			                <td class=text vAlign=center align=right>
			                <div class="wishlist_actions">
			                <a href="wishlist_details_view.php?wid={$v['id']}">View</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			                <a href="javascript:sendFriend({$v['id']})">Send List</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			                <a href="#" onclick="EditClick({$v['id']});" id="edit_{$v['id']}">Edit ListName</a>
			                <a href="javascript:;" onclick="SubmitClick({$v['id']});" style="display:none;" id="submit_{$v['id']}">Submit</a>
			                <a href="#" onclick="CancelClick({$v['id']},false);" style="display:none;margin-left:10px;" id="cancel_{$v['id']}">Cancel</a>
			                </div>
			                </td>
			    	      </tr>
			    	      $s

<!--
EOT;
} 
print <<<EOT
-->     	 
    	
    	    			</table>
                	  </td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="245" alt=""></td>
                      
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="538"><img name="" src="./images/spacer.gif" width="538" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      
                    </tr>
                    
                  </table>       
                  
                             
                  
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>  
                  
                  <table width="745" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" >
                      
                      <table width="720" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td  height="14" align="center" valign="middle" class="pageListings">{$page_show['pagelink']}</td>
                          </tr>
                       </table>                       
                        </td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>                    
                    </tr>
                   
                  </table> 
           </div>
          </div>  	
	   </div>

             
        
<!--
EOT;
?>-->